<?php defined('BASE_PATH') or die('No direct script access.');?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title><?php echo $title; ?></title>
        <!-- Global style sheets -->
        <?php
        $include_css=array(
                'reset',
                'common',
                'form',
                'standard',
                '960.gs',
                '960.gs.fluid',
                'simple-lists',
                'block-lists',
                'planning',
                'table',
                'calendars',
                'wizard',
                'gallery',
                'special-pages'
        );
        $file_css=NULL;
        foreach ($include_css as $css) {
            $file_css.=$css.',';
        }
        $file_css=substr($file_css,0,-1);
        unset($include_css);
        ?>
        <link href="<?php echo BASE_URL?>public/backend/css/mini.php?files=<?php echo $file_css; ?>" rel="stylesheet" type="text/css" />
        <!-- Favicon -->
        <link rel="shortcut icon" type="image/x-icon" href="<?php echo BASE_URL?>favicon.ico"/>
        <link rel="icon" type="image/png" href="<?php echo BASE_URL?>favicon-large.png"/>
        <!-- Generic libs -->
        <?php
        $include_JS=array(
                'html5',
                'jquery-1.4.2.min',
                'old-browsers',
                'jquery.accessibleList',
                'searchField',
                'common',
                'standard',
                'jquery.tip',
                'jquery.hashchange',
                'jquery.contextMenu',
                'list'
        );
        $file_JS=NULL;
        foreach ($include_JS as $JS) {
            $file_JS.=$JS.',';
        }
        $file_JS=substr($file_JS,0,-1);
        unset($include_JS);
        ?>
        <script type="text/javascript" src="<?php echo BASE_URL?>public/backend/js/mini.php?files=<?php echo $file_JS; ?>"></script>
        <!--[if lte IE 8]>
            <script type="text/javascript" src="<?php echo BASE_URL?>public/backend/js/standard.ie.js"></script>
        <![endif]-->
        <!-- Example context menu -->
        <script type="text/javascript">
            $(document).ready(function()
            {
                // Context menu for all favorites
                $('.favorites li').bind('contextMenu', function(event, list)
                {
                    var li = $(this);
                    // Add links to the menu
                    if (li.prev().length > 0)
                    {
                        list.push({ text: 'Move up', link:'#', icon:'up' });
                    }
                    if (li.next().length > 0)
                    {
                        list.push({ text: 'Move down', link:'#', icon:'down' });
                    }
                    list.push(false);	// Separator
                    list.push({ text: 'Delete', link:'#', icon:'delete' });
                    list.push({ text: 'Edit', link:'#', icon:'edit' });
                });

                // Extra options for the first one
                $('.favorites li:first').bind('contextMenu', function(event, list)
                {
                    list.push(false);	// Separator
                    list.push({ text: 'Settings', icon:'terminal', link:'#', subs:[
                            { text: 'General settings', link: '#', icon: 'blog' },
                            { text: 'System settings', link: '#', icon: 'server' },
                            { text: 'Website settings', link: '#', icon: 'network' }
                        ] });
                });

                // back previous page
                $('.back').click(function() { window.history.go(-1);});

                // check all
                $('a[href=#select_all]').click(function(){
                    $('input[name*="selected"]').attr('checked',true);
                    return false;
                });

                $('a[href=#unselect_all]').click(function(){
                    $('input[name*="selected"]').attr('checked',false);
                    return false;
                });
            });
        </script>
    </head>
    <body <?php if(!isset($_SESSION['admin'])) { ?>class="special-page login-bg dark"<?php }?>>
        <!-- The template uses conditional comments to add wrappers div for ie8 and ie7 - just add .ie or .ie7 prefix to your css selectors when needed -->
        <!--[if lt IE 9]><div class="ie"><![endif]-->
        <!--[if lt IE 8]><div class="ie7"><![endif]-->

        <!-- Header -->
        <!-- Server status -->
        <?php if(isset ($_SESSION['admin'])) { ?>
        <header>            
            <div class="container_12">
                <p id="skin-name"><small>Control Panel<br/> nguyenlong.info</small> <strong>1.0</strong></p>
                <div class="server-info">Server: <strong><?php echo $_SERVER['SERVER_NAME']?></strong></div>
                <div class="server-info">IP: <strong><?php echo $_SERVER['REMOTE_ADDR']?></strong></div>
            </div>
        </header>
        <!-- End server status -->
        <!-- Main nav -->
        <nav id="main-nav">
            <ul class="container_12">
                <li class="home <?php if($module=='index') { echo 'current';} ?>"><a href="#" title="Home">Home</a>
                    <ul>
                        <li><a href="<?php echo ADMIN_URL;?>" title="Dashboard">Dashboard</a></li>
                        <li><a href="#" title="My profile">My profile</a></li>
                        <li class="with-menu"><a href="#" title="My settings">My settings</a>
                            <div class="menu">
                                <img src="<?php echo BASE_URL?>public/backend/images/menu-open-arrow.png" width="16" height="16" alt="" />
                                <ul>
                                    <li class="icon_address"><a href="#">Browse by</a>
                                        <ul>
                                            <li class="icon_blog"><a href="#">Blog</a>
                                                <ul>
                                                    <li class="icon_alarm"><a href="#">Recents</a>
                                                        <ul>
                                                            <li class="icon_building"><a href="#">Corporate blog</a></li>
                                                            <li class="icon_newspaper"><a href="#">Press blog</a></li>
                                                        </ul>
                                                    </li>
                                                    <li class="icon_building"><a href="#">Corporate blog</a></li>
                                                    <li class="icon_computer"><a href="#">Support blog</a></li>
                                                    <li class="icon_search"><a href="#">Search...</a></li>
                                                </ul>
                                            </li>
                                            <li class="icon_server"><a href="#">Website</a></li>
                                            <li class="icon_network"><a href="#">Domain</a></li>
                                        </ul>
                                    </li>
                                    <li class="icon_export"><a href="#">Export</a>
                                        <ul>
                                            <li class="icon_doc_excel"><a href="#">Excel</a></li>
                                            <li class="icon_doc_csv"><a href="#">CSV</a></li>
                                            <li class="icon_doc_pdf"><a href="#">PDF</a></li>
                                            <li class="icon_doc_image"><a href="#">Image</a></li>
                                            <li class="icon_doc_web"><a href="#">Html</a></li>
                                        </ul>
                                    </li>
                                    <li class="sep"></li>
                                    <li class="icon_refresh"><a href="#">Reload</a></li>
                                    <li class="icon_reset">Reset</li>
                                    <li class="icon_search"><a href="#">Search</a></li>
                                    <li class="sep"></li>
                                    <li class="icon_terminal"><a href="#">Custom request</a></li>
                                    <li class="icon_battery"><a href="#">Stats server load</a></li>
                                </ul>
                            </div>
                        </li>
                    </ul>
                </li>
                <li class="write"><a href="#" title="Write">Write</a>
                    <ul>
                        <li><a href="#" title="Articles">Articles</a></li>
                        <li><a href="#" title="Add article">Add article</a></li>
                        <li><a href="#" title="Posts">Posts</a></li>
                        <li><a href="#" title="Add post">Add post</a></li>
                    </ul>
                </li>
                <li class="category <?php if($module=='category') { echo 'current';} ?>"><a href="#" title="Category">Category</a>
                    <ul>
                        <li><a href="<?php echo ADMIN_URL; ?>category" title="Category">Category</a></li>
                        <li class="with-menu"><a href="#" title="Add category">Add category</a>
                            <div class="menu">
                                <img src="<?php echo BASE_URL;?>public/backend/images/menu-open-arrow.png" width="16" height="16" alt="" />
                                <ul>
                                    <li class="icon_add_16"><a href="#">Article category</a></li>
                                    <li class="icon_add_16"><a href="#">Product category</a></li>
                                </ul>
                            </div>
                        </li>
                    </ul>
                </li>
                <li class="module"><a href="#" title="Modules">Modules</a>
                    <ul>
                        <li><a href="#" title="Modules">Modules</a></li>
                        <li><a href="#" title="Add module">Add Module</a></li>
                    </ul>
                </li>
                <li class="comments"><a href="#" title="Comments">Comments</a>
                    <ul>
                        <li><a href="#" title="Manage">Manage</a></li>
                        <li><a href="#" title="Spams">Spams</a></li>
                    </ul>
                </li>
                <li class="medias"><a href="#" title="Medias">Medias</a>
                    <ul>
                        <li><a href="#" title="Browse">Browse</a></li>
                        <li><a href="#" title="Add file">Add file</a></li>
                        <li><a href="#" title="Manage">Manage</a></li>
                        <li><a href="#" title="Settings">Settings</a></li>
                    </ul>
                </li>
                <li class="users"><a href="#" title="Users">Users</a>
                    <ul>
                        <li class="current"><a href="<?php echo BASE_URL?>users" title="Browse">List</a></li>
                        <li><a href="#" title="Add user">Add user</a></li>
                        <li><a href="#" title="Settings">Settings</a></li>
                    </ul>
                </li>
                <li class="stats"><a href="#" title="Stats">Stats</a></li>
                <li class="settings"><a href="#" title="Settings">Settings</a></li>
                <li class="backup"><a href="#" title="Backup">Backup</a></li>
            </ul>
        </nav>
        <!-- End main nav -->
        <!-- Sub nav -->
        <div id="sub-nav"><div class="container_12">
                <a href="#" title="Help" class="nav-button"><b>Help</b></a>
                <form id="search-form" name="search-form" method="post" action="search.html">
                    <input type="text" name="s" id="s" value="" title="Search admin..." autocomplete="off"/>
                </form>
            </div></div>
        <!-- End sub nav -->
        <!-- Status bar -->
        <div id="status-bar" ><div class="container_12">
                <ul id="status-infos" >
                    <li class="spaced">Logged as: <strong>Admin</strong></li>
                    <li>
                        <a href="#" class="button" title="5 messages"><img src="<?php echo BASE_URL?>public/backend/images/icons/fugue/mail.png" width="16" height="16" alt="" /> <strong>5</strong></a>
                        <div id="messages-list" class="result-block">
                            <span class="arrow"><span></span></span>
                            <ul class="small-files-list icon-mail">
                                <li>
                                    <a href="#"><strong>10:15</strong> Please update...<br/>
                                        <small>From: System</small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>Yest.</strong> Hi<br/>
                                        <small>From: Jane</small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>Yest.</strong> System update<br/>
                                        <small>From: System</small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>2 days</strong> Database backup<br/>
                                        <small>From: System</small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>2 days</strong> Re: bug report<br/>
                                        <small>From: Max</small>
                                    </a>
                                </li>
                            </ul>

                            <p id="messages-info" class="result-info"><a href="#">Go to inbox &raquo;</a></p>
                        </div>
                    </li>
                    <li>&nbsp;
                        <a href="#" class="button" title="25 comments"><img src="<?php echo BASE_URL?>public/backend/images/icons/fugue/balloon.png" width="16" height="16" alt=""/> <strong>25</strong></a>
                        <div id="comments-list" class="result-block">
                            <span class="arrow"><span></span></span>
                            <ul class="small-files-list icon-comment">
                                <li>
                                    <a href="#"><strong>Jane</strong>: I don't think so<br/>
                                        <small>On <strong>Post title</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>Ken_54</strong>: What about using a different...<br/>
                                        <small>On <strong>Post title</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>Jane</strong> Sure, but no more.<br/>
                                        <small>On <strong>Another post</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>Max</strong>: Have you seen that...<br/>
                                        <small>On <strong>Post title</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>Anonymous</strong>: Good luck!<br/>
                                        <small>On <strong>My first post</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>SÃ©bastien</strong>: This sure rocks!<br/>
                                        <small>On <strong>Another post title</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>John</strong>: Me too!<br/>
                                        <small>On <strong>Third post title</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>John</strong> This can be solved by...<br/>
                                        <small>On <strong>Another post</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>Jane</strong>: No prob.<br/>
                                        <small>On <strong>Post title</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>Anonymous</strong>: I had the following...<br/>
                                        <small>On <strong>My first post</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>Anonymous</strong>: Yes<br/>
                                        <small>On <strong>Post title</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>Lian</strong>: Please make sure that...<br/>
                                        <small>On <strong>Last post title</strong></small></a>
                                </li>
                                <li>
                                    <a href="#"><strong>Ann</strong> Thanks!<br/>
                                        <small>On <strong>Last post</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>Max</strong>: Don't tell me what...<br/>
                                        <small>On <strong>Post title</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>Gordon</strong>: Here is an article about...<br/>
                                        <small>On <strong>My another post</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>Lee</strong>: Try to reset the value first<br/>
                                        <small>On <strong>Last title</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>Lee</strong>: Sure!<br/>
                                        <small>On <strong>Second post title</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>Many</strong> Great job, keep on!<br/>
                                        <small>On <strong>Third post</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>John</strong>: I really like this<br/>
                                        <small>On <strong>First title</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>Paul</strong>: Hello, I have an issue with...<br/>
                                        <small>On <strong>My first post</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>June</strong>: Yuck.<br/>
                                        <small>On <strong>Another title</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>Jane</strong>: Wow, sounds amazing, do...<br/>
                                        <small>On <strong>Another title</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>Esther</strong>: Man, this is the best...<br/>
                                        <small>On <strong>Another post</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>Max</strong>: Thanks!<br/>
                                        <small>On <strong>Post title</strong></small>
                                    </a>
                                </li>
                                <li>
                                    <a href="#"><strong>John</strong>: I'd say it is not safe...<br/>
                                        <small>On <strong>My first post</strong></small>
                                    </a>
                                </li>
                            </ul>
                            <p id="comments-info" class="result-info"><a href="#">Manage comments &raquo;</a></p>
                        </div>
                    </li>
                    <li>&nbsp;<a href="<?php echo ADMIN_URL;?>logout/" class="button red" title="Logout"><span class="smaller">LOGOUT</span></a></li>
                </ul>

                <ul id="breadcrumb">
                    <li><a href="<?php echo ADMIN_URL; ?>">Administrator</a></li>
                    <?php
                            if(isset ($breadcrumb)){
                                $link=NULL;
                                foreach ($breadcrumb as $k => $v){
                                    if($link!=NULL){$k=$link.'/'.$k;}
                                    echo '<li><a href="'.ADMIN_URL.$k.'">'.$v.'</a></li>';
                                    $link=$k;
                                }
                            }
                        ?>
                </ul>
            </div></div>
        <!-- End status bar -->
        <div id="header-shadow"></div>
        <!-- End header -->
            <?php } ?>
        <?php
        if(isset ($right)) {
            foreach ($right as $l) {
                if($l['data']!=NULL)
                    foreach ($l['data'] as $key => $value) {
                        unset($$key);
                        $$key = $value;
                    }
                include $l['path'];
            }
            unset($right);
}
        ?>
        <!-- show tất cả nội dung ở đây -->
        <?php
        if(isset ($left)) {
            foreach ($left as $l) {
                if($l['data']!=NULL)
                    foreach ($l['data'] as $key => $value) {
                        unset($$key);
                        $$key = $value;
                    }
                include $l['path'];
            }
            unset ($left);
        }
?>
<?php if(isset ($_SESSION['admin'])) { ?>
        <!-- end show tất cả nội dung ở đây -->
        <footer>
            <div class="float-left">
                <a href="#" class="button">Help</a>
                <a href="#" class="button">About</a>
            </div>
            <div class="float-right">
                <a href="#top" class="button"><img src="<?php echo BASE_URL?>public/backend/images/icons/fugue/navigation-090.png" width="16" height="16" alt=""/> Page top</a>
            </div>
        </footer>
    <?php } ?>
        <!--[if lt IE 8]></div><![endif]-->
        <!--[if lt IE 9]></div><![endif]-->
    </body>
</html>